#include <iostream>
#include <stack>
#include <string>
using namespace std;

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string s;
  int num = 0;
  stack<int> sta;

  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] >= '0' && s[i] <= '9') {
      num = num * 10 + s[i] - '0';
    } else if (s[i] == '.') {
      sta.push(num);
      num = 0;
    } else if (s[i] == '@') {
      cout << sta.top() << "\n";
    } else {
      int lhs, rhs;

      rhs = sta.top();
      sta.pop();
      lhs = sta.top();
      sta.pop();
      if (s[i] == '+') {
        sta.push(lhs + rhs);
      } else if (s[i] == '-') {
        sta.push(lhs - rhs);
      } else if (s[i] == '*') {
        sta.push(lhs * rhs);
      } else if (s[i] == '/') {
        sta.push(lhs / rhs);
      }
    }
  }
  return 0;
}